import { _decorator, SpriteFrame } from 'cc';
import { SSS_Consts } from "./SSS_Consts";
import { YangLeGeYang_LevelList } from '../Game/DanCiPeiDui/YangLeGeYang_LevelList';
import { bdlMgr } from '../Manager/BundleManager_S';

// /**游戏数据 */
export class SSS_GameData {
    static list = [
        { name: `蜘蛛纸牌`, game: `蜘蛛纸牌`, icon: `蜘蛛纸牌`, scene: SSS_Consts.SceneName.SpiderSolitaire_Game_Scene },

        { name: `2048`, game: `2048`, icon: `2048`, scene: SSS_Consts.SceneName.S2048_Main_Scene },

        { name: `倒水排序`, game: `倒水排序`, icon: `倒水排序`, scene: SSS_Consts.SceneName.DaoShuiPaiXu_Main_Scene },

        // { name: `救救小动物`, game: `救救小动物`, icon: `救救小动物`, scene: SSS_Consts.SceneName.JiuJiuXiaoDongWu_Game_Scene },
        { name: `连连看`, game: `连连看`, icon: `连连看`, scene: SSS_Consts.SceneName.LianLianKan_Game_Scene },

        { name: `消了个消`, game: `消了个消`, icon: `消了个消`, scene: SSS_Consts.SceneName.YangLeGeYang_Game_Scene },

        // // { name: `中国象棋`, game: `中国象棋`, icon: `中国象棋`, scene: SSS_Consts.SceneName.Xiangqi_Game_Scene },

        // // { name: `合了个10`, game: `合了个10`, icon: `合了个10 `, scene: SSS_Consts.SceneName.HeLeGe10_Game_Scene },
        // // { name: `算24点`, game: `算24点`, icon: `算24点`, scene: SSS_Consts.SceneName.Suan24Dian_Game_Scene },
        // // { name: `合成大西瓜`, game: `合成大西瓜`, icon: `合成大西瓜`, scene: SSS_Consts.SceneName.HeChengDaXiGua_Game_Scene },
        // { name: `泡泡西瓜`, game: `泡泡西瓜`, icon: `泡泡西瓜`, scene: SSS_Consts.SceneName.PaoPaoXiGua_Game_Scene },
        // { name: `土耳其方块`, game: `土耳其方块`, icon: `土耳其方块`, scene: SSS_Consts.SceneName.土耳其方块_Game_Scene },
        // { name: `俄罗斯拖方块`, game: `俄罗斯拖方块`, icon: `俄罗斯拖方块`, scene: SSS_Consts.SceneName.俄罗斯拖方块_Game_Scene },
        // { name: `扫雷`, game: `扫雷`, icon: `扫雷`, scene: SSS_Consts.SceneName.Minesweeper_Game_Scene },
        // { name: `数字华容道`, game: `数字华容道`, icon: `数字华容道`, scene: SSS_Consts.SceneName.ShuZiHuaRongDao_Main_Scene },
        // { name: `五子棋`, game: `五子棋`, icon: `五子棋`, scene: SSS_Consts.SceneName.Gomoku_Game_Scene },
        // { name: `围住小猫猫`, game: `围住小猫猫`, icon: `围住小猫猫`, scene: SSS_Consts.SceneName.CircleTheCat_Game_Scene },

        // { name: `成语接龙`, game: `成语接龙`, icon: `成语接龙`, scene: SSS_Consts.SceneName.成语游戏_Game_Scene },

        // { name: `飞翔小鸟`, game: `飞翔小鸟`, icon: `飞翔小鸟`, scene: SSS_Consts.SceneName.飞翔小鸟 },
        // { name: `足球巨星`, game: `足球巨星`, icon: `足球巨星`, scene: SSS_Consts.SceneName.SoccerStars_Game_Scene },
        // { name: `倒水`, game: `倒水`, icon: `倒水`, scene: SSS_Consts.SceneName.倒水 },
        // { name: `许愿新游戏`, game: `许愿新游戏`, icon: `许愿新游戏`, scene: null },
        // { name: `五花肉`, game: `五花肉`, icon: `五花肉`, scene: SSS_Consts.SceneName.五花肉 },
        // { name: `汉诺塔`, game: `汉诺塔`, icon: `汉诺塔`, scene: SSS_Consts.SceneName.汉诺塔_Main_Scene },
        // { name: `华容道拼图`, game: `华容道拼图`, icon: `华容道拼图`, scene: SSS_Consts.SceneName.HuaRongDaoPintu_Level_Scene },

        // { name: `数独`, game: `数独`, icon: `数独`, scene: SSS_Consts.SceneName.数独 },
    ]

    public static All_Sprite_List = [];

    //    /**首次进入游戏首页 */
    static isFirstEnterMainScene = true;

    //    /** Colors */
    static colors = [
        { id: `蓝色背景-合成大西瓜`, color: "#8394C2", Label_color: "#" },
        { id: `紫色背景-土耳其方块`, color: "#392842", Label_color: "#" },
        { id: `暗红色背景-2048`, color: "#C67D73", Label_color: "#" },
        { id: `深灰色背景-扫雷`, color: "#424952", Label_color: "#" },
        //        // 黄: `#FFF2D7`,
        //        // 绿 : `#CAEAD8`,
        //        // 灰 : `#F4F4F4`,
        //        // 蓝 = `#E0EFFF`,
        //        // 粉 = `#FFEAEF`,
        //        // 紫 = `#E6E3F6`,
        //        // 羊蓝 = `#A5E2E8`,
        //        // 羊绿 = `#CDE6C5`,
    ]

    //    // public static ClearData() {
    //    // }

    static InitData() {
        SSS_GameData.All_Sprite_List = SSS_GameData.Get_AllList();
    }

    static Get_AllList() {
        let array = [];

        for (let index = 0; index < YangLeGeYang_LevelList.wordList.length; index++) {
            const item_list = YangLeGeYang_LevelList.wordList[index];
            // console.log(`item_data`, item_list);

            for (let index_2 = 0; index_2 < item_list.list.length; index_2++) {
                const item_data = item_list.list[index_2];
                // console.log(`item_data`, item_data);

                let res = {
                    key: item_data,
                    root: item_list.root,
                }
                array.push(res);
            }
        }

        // console.log(`res_arr`, array);

        return array;
    }

    static 预加载() {
        let list = SSS_GameData.All_Sprite_List;
        for (let index = 0; index < list.length; index++) {
            let item_data = list[index];
            bdlMgr.getRes<SpriteFrame>(`YangLeGeYang_Sprite`, `icon_e/${item_data.root}/${item_data.key}/spriteFrame`, SpriteFrame).then(res => {
            });
        }
    }
}

window['SSS_GameData'] = SSS_GameData;